<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: jerry
  Date: 12/16/2024
  Time: 14:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>用户注册</title>
</head>
<body>
<h1>注册</h1>

<form action="register" method="post" >
    <label for="name">昵称</label>
    <input type="text" id="name" name="name" required><br><br>

    <label for="password">密码</label>
    <input type="password" id="password" name="password" required><br><br>

    <input type="submit" value="Register" onsubmit="encryptCredentials()">
</form>
<c:set var="error" value="${param.error}"/>

<c:if test="${not empty error}">
    <p style="color: red;">${error}</p>
</c:if>
<p>
    已有账号？<a href=".">登录</a>
</p>
<script src="crypt.js" type="application/javascript"></script>
</body>
</html>
